﻿
using System;
using System.Collections.Generic;
using System.ComponentModel.DataAnnotations;
using System.Linq;
using System.Threading.Tasks;
using WalkingTec.Mvvm.Core;
using WalkingTec.Mvvm.Core.Extensions;
using Digitalmes.Model.ProductManagement;
using Digitalmes.Model;
using Digitalmes.Model.WmsManagement;

namespace Digitalmes.ViewModel.ProductManagement.ProductVMs
{
    public partial class ProductTemplateVM : BaseTemplateVM
    {
        
        [Display(Name = "_Model._Product._Name")]
        public ExcelPropety Name_Excel = ExcelPropety.CreateProperty<Product>(x => x.Name);
        [Display(Name = "_Model._Product._Code")]
        public ExcelPropety Code_Excel = ExcelPropety.CreateProperty<Product>(x => x.Code);
        [Display(Name = "_Model._Product._Material")]
        public ExcelPropety Material_Excel = ExcelPropety.CreateProperty<Product>(x => x.MaterialId);
        [Display(Name = "_Model._Product._Active")]
        public ExcelPropety Active_Excel = ExcelPropety.CreateProperty<Product>(x => x.Active);
        [Display(Name = "_Model._Product._ErpCode")]
        public ExcelPropety ErpCode_Excel = ExcelPropety.CreateProperty<Product>(x => x.ErpCode);
        [Display(Name = "_Model._Product._CreateTime")]
        public ExcelPropety CreateTime_Excel = ExcelPropety.CreateProperty<Product>(x => x.CreateTime, true);
        [Display(Name = "_Model._Product._UpdateTime")]
        public ExcelPropety UpdateTime_Excel = ExcelPropety.CreateProperty<Product>(x => x.UpdateTime, true);
        [Display(Name = "_Model._Product._CreateBy")]
        public ExcelPropety CreateBy_Excel = ExcelPropety.CreateProperty<Product>(x => x.CreateBy);
        [Display(Name = "_Model._Product._UpdateBy")]
        public ExcelPropety UpdateBy_Excel = ExcelPropety.CreateProperty<Product>(x => x.UpdateBy);
        [Display(Name = "_Model._Product._IsValid")]
        public ExcelPropety IsValid_Excel = ExcelPropety.CreateProperty<Product>(x => x.IsValid);
        [Display(Name = "_Model._Product._TenantCode")]
        public ExcelPropety TenantCode_Excel = ExcelPropety.CreateProperty<Product>(x => x.TenantCode);

	    protected override void InitVM()
        {
            
            Material_Excel.DataType = ColumnDataType.ComboBox;
            Material_Excel.ListItems = DC.Set<MaterialDoc>().GetSelectListItems(Wtm, y => y.TenantCode.ToString());

        }

    }

    public class ProductImportVM : BaseImportVM<ProductTemplateVM, Product>
    {
            //import

    }

}